package cn.javadog.smartbreeding.record.controller;

import cn.javadog.smartbreeding.core.dto.WeightRecordDTO;
import cn.javadog.smartbreeding.core.service.WeightRecordService;
import cn.javadog.smartbreeding.core.config.util.Ret;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 余勇
 */
@Api(tags = "重量记录")
@RestController
@RequestMapping("weight/records")
public class WeightRecordController{

	@Autowired
	private WeightRecordService weightRecordService;

	@ApiOperation("重量录入")
	@PostMapping
	public Ret save(@RequestBody WeightRecordDTO dto) {
		return Ret.ok(weightRecordService.save(dto));
	}
}
